package vn.outsource.weather.ui;

import net.simonvt.calendarview.CalendarView;
import net.simonvt.calendarview.CalendarView.OnDateChangeListener;
import vn.tdx.androidlibs.ui.BaseFragmentActivity;
import vn.tdx.androidlibs.ui.customeview.NavigationBar.OnNavigationClickListener;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.Toast;

import com.example.com.outsource.weather.R;

public class CalendarActivity extends BaseFragmentActivity implements
		OnDateChangeListener, OnClickListener {
	private static final String TAG = "CalendarActivity";

	private CalendarView mCalendarView;

	private ImageView mimgLeftNavigation;
	private ImageView mimgRighNavigation;

	@Override
	protected void onCreate(Bundle arg0) {
		super.onCreate(arg0);
		initView();
		// getNavigationBar().setNavigationLeftLogo(R.drawable.btn_back);
	}

	private void initView() {
		mCalendarView = (CalendarView) findViewById(R.id.activity_calendar_view);
		mimgLeftNavigation = (ImageView) findViewById(R.id.cv_navigation_bar_img_left);
		mimgRighNavigation = (ImageView) findViewById(R.id.cv_navigation_bar_img_right);

		mimgLeftNavigation.setImageResource(R.drawable.btn_back);
		mimgRighNavigation.setVisibility(View.INVISIBLE);

		mimgLeftNavigation.setOnClickListener(this);
		mimgRighNavigation.setOnClickListener(this);
		mCalendarView.setOnDateChangeListener(this);
	}

	@Override
	public void onSelectedDayChange(CalendarView view, int year, int month,
			int dayOfMonth) {
//		Toast.makeText(
//				getApplicationContext(),
//				"year=" + year + ", month=" + month + ", dayOfMonth="
//						+ dayOfMonth, Toast.LENGTH_LONG).show();

	}

	@Override
	protected void setContentView(Bundle bundle) {
		setContentView(R.layout.activity_calendar);
	}

	@Override
	protected boolean isNavigationEnable() {
		return false;
	}

	@Override
	public void onClick(View v) {
		if (v.getId() == R.id.cv_navigation_bar_img_left) {
			finish();
		}
	}
}
